import {
  http
} from '@/utils/http.js'


// 获取用户地址
export const getAddressApi = () => {
  return http.get('/patient/order/address')
}


// 药品预付订单
export const preOrderApi = (prescriptionId) => {
  return http.get('/patient/medicine/order/pre', {
    params: {
      prescriptionId
    }
  })
}


/**
 * 药品待支付订单
 */
export const createOrderApi = (id, addressId) => {
  return http.post('/patient/medicine/order', {
    id,
    addressId
  })
}


// 获取订单详情
export const getOrderDetailApi = (id) => {
  return http.get(`/patient/medicine/order/detail/${id}`)
}


// 物流信息
export const getlogisticsInfoApi = (id) => {
  return http.get(`/patient/order/${id}/logistics`)
}